import React from 'react';
import { Popconfirm } from 'antd';

const Index = props => {
  const {
    disabled,

    children,
    ...rest
  } = props;

  return (
    <Popconfirm {...rest} disabled={disabled}>
      {children &&
        React.cloneElement(children, {
          disabled,
        })}
    </Popconfirm>
  );
};

Object.keys(Popconfirm).forEach(item => {
  if (!['defaultProps'].includes(item)) {
    Index[item] = Popconfirm[item];
  }
});
Index.displayName = 'Popconfirm';
export default Index;
